import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description: 自定义实现mySort
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-08-02  11:43
 */
public class Test1 {
    public static void main(String[] args) {
        int[] array = {1,9,2,8,3};
        mySort(array);
        for (int x : array) {
            System.out.print(x + " ");
        }
    }

    public static void mySort(int[] array) {
        for (int i = 0; i < array.length-1; i++) {
            for (int j = 0; j < array.length-1-i; j++) {
                if(array[j] > array[j+1]) {
                    int tmp = array[j];
                    array[j] = array[j+1];
                    array[j+1] = tmp;
                }
            }
        }
        return ;
    }
}
